<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>

        <title>#{msg.TitoloLogin}</title>
    </h:head>

    <h:body>

        #{redirect.redirectLogin(null, true)}

        <div class="container">

            <ui:include src="Header.xhtml"/>

            <div class="content">

                <p:messages id="messaggio" autoUpdate="true" closable="true" />

                <table class="container">

                    <tr >

                        <td class="formLogin">

                            <h:form>

                                <h3>

                                    <p:outputLabel value="#{msg.TitoloLogin}"/>
                                </h3>

                                <h:panelGrid class="spazioLeft10" id="grid" columns="1">

                                    <p:outputLabel for="email" value="#{msg.emailForm}"/>
                                    <p:inputText id="email" required="true" requiredMessage="#{msg.emailRequiredM}" value="#{login.email}">

                                        <f:validator validatorId="emailValidator"/>
                                    </p:inputText>

                                    <p:outputLabel for="password" value="#{msg.passwordForm}"/>
                                    <p:password id="password" requiredMessage="#{msg.passwordRequiredM}"  
                                                required="true" value="#{login.password}" />
                                    <p:commandButton update="grid" value="#{msg.TitoloLogin}" action="#{login.accesso(gestioneCliente, gestioneSito, gestioneNegozio)}"/>
                                </h:panelGrid>
                            </h:form>

                        </td>

                        <td align="center" class="formLogin">

                            <h3>

                                <p:outputLabel value="#{msg.testo1RegLogin}"/>
                            </h3>
                            <p:outputLabel value="#{msg.testo2RegLogin}"/>

                            <h:form >

                                <p:commandButton style="color: #831608" value="#{msg.TitoloRegistrazione}" action="#{login.registraUtente()}"/>
                            </h:form>
                        </td>
                    </tr>
                </table>
            </div><!-- End content /div -->
            <ui:include src="Footer.xhtml"/>
        </div><!-- End container /div -->
    </h:body>
</html>

